Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

save path tests from symlink confusion, fixes #231 #375

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ivanov
Copy link
Member

@ivanov ivanov commented Nov 17, 2023

following this comment in #231

@mtelka could you please try this out and report back if this fixes the last set of failures you see on your OpenIndiana rig? Thank you!

@ivanov ivanov linked an issue Nov 17, 2023 that may be closed by this pull request
@mtelka
Copy link

mtelka commented Nov 17, 2023

I tested jupyter_core 5.5.0 with 5f24503 applied and the failure is very similar to the one reported in #231 (comment).

Please note that /usr/share/jupyter and /usr/local/share/jupyter does not point to the same target so pure realpath() cannot solve the issue. On default OpenIndiana install the /usr/local does not exist. On my test machine it is a symlink to /opt/local as documented here so with 5f24503 the failure of test_jupyter_path_user_site is this now:

_________________________ test_jupyter_path_user_site __________________________

    def test_jupyter_path_user_site():
        with patch.object(site, "ENABLE_USER_SITE", True):
            path = jupyter_path()

            # deduplicated expected values
            values = list(
                dict.fromkeys(
                    [   
                        jupyter_data_dir(),
                        os.path.join(site.getuserbase(), "share", "jupyter"),
                        paths.ENV_JUPYTER_PATH[0],
                    ]
                )
            )
            for p, v in zip(path, values):
>               assert realpath(p) == realpath(v)
E               AssertionError: assert '/opt/local/share/jupyter' == '/usr/share/jupyter'
E                 - /usr/share/jupyter
E                 + /opt/local/share/jupyter

p          = '/usr/local/share/jupyter'
path       = ['/home/marcel/.local/share/jupyter', '/usr/local/share/jupyter', '/usr/share/jupyter']
v          = '/usr/share/jupyter'
values     = ['/home/marcel/.local/share/jupyter', '/usr/share/jupyter']

tests/test_paths.py:300: AssertionError

The other two tests fails with the exactly same error output as before.

@ivanov
Copy link
Member Author

ivanov commented Nov 17, 2023

Ah, ok, I wrongly assumed that it was a symlink resolution issue. What do you think is the path forward ?

@mtelka
Copy link

mtelka commented Nov 20, 2023

What about to find the root cause first? :-)

@ivanov
Copy link
Member Author

ivanov commented Dec 18, 2023

What about to find the root cause first? :-)

I fully support that, but lack a system that reproduces this error, which is why I ask for help.

@mtelka
Copy link

mtelka commented Dec 18, 2023

What about to find the root cause first? :-)

I fully support that, but lack a system that reproduces this error, which is why I ask for help.

What kind of help do you need? I know nothing about jupiter_core, but I can run any suggested patches. I can even root cause a bit, but I need more info about jupiter_core.

For example with test_jupyter_path_user_site: what do you think is wrong? The jupyter_core itself, or the test itself with wrong expectation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4.7.1: pytest is failing
2 participants